USE [SONALIKA_BGK_UPDATED]
GO

/****** Object:  Table [dbo].[OLD_TRACTORS]    Script Date: 13-May-14 1:03:25 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[OLD_TRACTORS](
	[OLDTRACTOR_ID] [int] IDENTITY(1,1) NOT NULL,
	[CUSTOMER_NAME] [varchar](50) NOT NULL,
	[TRACTOR_MAKE] [varchar](50) NOT NULL,
	[TRACTOR_MODEL] [varchar](50) NOT NULL,
	[TRACTOR_REGISTRATION_NO] [varchar](50) NOT NULL,
	[TRACTOR_YEAR] [int] NOT NULL,
	[TRACTOR_RCBOOK_NO] [varchar](50) NULL,
	[TRACTOR_EMPLIMENT] [varchar](50) NULL,
	[PURCHASE_COST] [decimal](18, 2) NOT NULL,
	[SELLING_COST] [decimal](18, 2) NOT NULL,
	[TRACTOR_EXCHANGE_MODELID] [int] NULL,
 CONSTRAINT [PK_OLD_TRACTORS] PRIMARY KEY CLUSTERED 
(
	[OLDTRACTOR_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[OLD_TRACTORS]  WITH CHECK ADD  CONSTRAINT [FK_OLD_TRACTORS_TRACTOR_MODELS] FOREIGN KEY([TRACTOR_EXCHANGE_MODELID])
REFERENCES [dbo].[TRACTOR_MODELS] ([TRACTOR_MODEL_ID])
GO

ALTER TABLE [dbo].[OLD_TRACTORS] CHECK CONSTRAINT [FK_OLD_TRACTORS_TRACTOR_MODELS]
GO


